Skip to content

feat(ai): add Rapid-MLX memory provider preset - #553

Draft
raullenchai wants to merge 1 commit into
tickernelz:mainfrom
raullenchai:feat/rapid-mlx-preset
Draft

raullenchai wants to merge 1 commit into
tickernelz:mainfrom
raullenchai:feat/rapid-mlx-preset

Conversation

@raullenchai

Copy link
Copy Markdown

Summary

Adds a rapid-mlx memory provider preset for Rapid-MLX, a local OpenAI-compatible inference server for Apple Silicon Macs. It is registered like the other presets (an entry in src/ai/memory-provider-presets.ts on top of PresetOpenAIChatProvider, no new provider class).

  • memoryProvider: "rapid-mlx": endpoint defaults to http://127.0.0.1:8000/v1, model defaults to default (Rapid-MLX maps this to the model the server has loaded; memoryModel can name a served id or alias such as qwen3.5-4b-4bit).
  • A local server usually runs without auth, so presets can now declare apiKeyOptional. Only rapid-mlx sets it. With no key, config resolution and the auto-capture readiness check accept the config and PresetOpenAIChatProvider sends no Authorization header. If the server was started with --api-key, memoryApiKey or RAPID_MLX_API_KEY is used. Placeholder keys are still rejected, and every other preset and registry entry still requires a key.
  • Docs: README and the six i18n READMEs, opencode-mem.example.jsonc, config template comments, and the preset lists for forceToolChoice.
  • Tests: key-less resolution with defaults filled, env key pickup, placeholder rejection, other presets still require a key, and the preset request matrix (no Authorization header when key-less).

Test plan

  • Exercised the change locally: with a temp HOME whose opencode-mem.jsonc only sets "memoryProvider": "rapid-mlx" (no key), CONFIG resolved to http://127.0.0.1:8000/v1 / default, autoCaptureProviderStatus was ready, and AIProviderFactory.createProvider(...).executeToolCall(...) against a real rapid-mlx serve qwen3.5-4b-4bit --port 8000 returned a forced save_memories tool call with two parsed memories (about 0.8 s, 1 iteration).
  • Noted any follow-up or known limitations: Rapid-MLX is used for the memory model only; embeddings stay on the existing local ONNX or embeddingApiUrl paths.

Checklist

  • Branch is based on main (do not open PRs from commits already on main)
  • bun test passes (1343 pass, 4 skip, 0 fail, after bun run build for the dist entrypoint tests)
  • bun run typecheck passes
  • bun run check passes
  • Docs / README updated when behavior or contribution process changes

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant